package com.ssy.lingxi.pay.entity.assetAccount;

import lombok.Data;

import javax.persistence.*;

/**
 * 资金账户
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/7/21
 */
@Data
@Entity
@Table(schema = "public", name = "pay_member_asset_account", indexes = {@Index(name = "pay_member_asset_account_member_id_idx", columnList = "memberId"),
        @Index(name = "pay_member_asset_account_member_role_id_idx", columnList = "memberRoleId"),
        @Index(name = "pay_member_asset_account_parent_member_id_idx", columnList = "parentMemberId"),
        @Index(name = "pay_member_asset_account_parent_role_id_idx", columnList = "parentMemberRoleId"),
        @Index(name = "pay_member_asset_account_member_level_type_idx", columnList = "memberLevelType")})
public class MemberAssetAccount {
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="member_asset_account_seq")
    @SequenceGenerator(sequenceName="pay_member_asset_account_seq", name="member_asset_account_seq",allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(60)", nullable = false)
    private String memberName;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberRoleId;

    /**
     * 会员角色名称
     */
    @Column(columnDefinition = "varchar(60)", nullable = false)
    private String memberRoleName;

    /**
     * 父级会员id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long parentMemberId;

    /**
     * 父级会员名称
     */
    @Column(columnDefinition = "varchar(60)", nullable = false)
    private String parentMemberName;

    /**
     * 父级会员角色id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long parentMemberRoleId;

    /**
     * 父级会员角色名称
     */
    @Column(columnDefinition = "varchar(60)", nullable = false)
    private String parentMemberRoleName;

    /**
     * 会员类型: 1-企业会员; 2-企业个人会员; 3-渠道会员; 4-渠道个人会员
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer memberType;

    /**
     * 会员等级类型: 1-平台会员; 2-商户会员; 3-渠道会员
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer memberLevelType;

    /**
     * 账户余额
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double accountBalance;

    /**
     * 账户余额(密文)
     */
    @Column(columnDefinition = "varchar(100)", nullable = false)
    private String accountBalanceEncrypt;

    /**
     * 锁定余额
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double lockBalance;

    /**
     * 锁定余额(密文)
     */
    @Column(columnDefinition = "varchar(100)", nullable = false)
    private String lockBalanceEncrypt;

    /**
     * 会员状态: 1-正常, 2-已冻结
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer memberStatus;

    /**
     * 账户状态: 1-正常, 2-已冻结
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer accountStatus;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long createTime;
}
